<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      display: flex;
      /* 是否换行 flex-wrap */
      flex-wrap: wrap;
      /* 修改主轴方向 */
      /* flex-direction: column; */
      /* 主轴方向上排列方式 */
      /* justify-content: center; */
      /* justify-content: space-between; */
      /* justify-content: space-around; */
      /* justify-content: space-evenly; */
      /* 侧轴方向上弹性容器排列方式  stretch需要子级没有高度*/
      /* align-items: stretch; */
      /* align-items: center; */
      height: 300px;
      border: 1px solid #000;
    }

    .box div {
      width: 200px;
      height: 100px;
      background-color: pink;
    }

    /* 侧轴方向上弹性盒子排列方式  stretch需要子级没有高度*/
    /* .box div:first-child {
      align-self: center;
    } */
    .box div:first-child {
      width: 50px;
    }

    .box div:nth-child(2) {
      flex: 1;
    }

    /* .box div:nth-child(3) {
      flex: 2;
    } */
  </style>
</head>

<body>
  <div class="box">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>7</div>
    <div>8</div>
    <div>9</div>
    <div>10</div>
    <div>11</div>
    <div>12</div>
  </div>
</body>

</html>